<script>
function listapcs1(){
			
			var aula=document.getElementById("aula1").value;
			
			var xmlhttp;
                if (window.XMLHttpRequest)
                {// code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp=new XMLHttpRequest();
                }
                else
                 {// code for IE6, IE5
                     xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                 }
            xmlhttp.onreadystatechange=function()
             {
                if (xmlhttp.readyState==4 && xmlhttp.status==200)
                 {
						
						document.getElementById("pcs1").innerHTML=xmlhttp.responseText;    
					
                 }
				
               	
			   }
        	
            xmlhttp.open("GET","php/listapcs1.php?aula="+aula,true);
            xmlhttp.send();
}

</script>
<?php
include("conexionbd.php");


echo '<form>
				<table border="1">
				<tr>
					<td>';
						
							
							$res=mysql_query("select * from aulas",$con);
							echo " <select id='aula1' onchange='listapcs1()'>
							<option value='0'></option>";
							while($row = mysql_fetch_array($res)){
							 
							
							
								$id_aula1=$row['id_aula'];
								$aula1=$row['num_aula'];
								echo "<option value='$id_aula1'>$aula1</option>";
							}
							echo "</select>";
						
					echo "</td>
					<td></td>
					<td>";
						
							
							$res=mysql_query("select * from aulas",$con);
							echo " <select id='aula2' onchange='listapcs2()'>
							<option value='0'></option>";
							while($row = mysql_fetch_array($res)){
							 
							
							
								$id_aula2=$row['id_aula'];
								$aula2=$row['num_aula'];
								echo "<option value='$id_aula2'>$aula2</option>";
							}
							echo "</select>";
						
					echo '</td>
				</tr>
				<tr>
					<td>
						<div id="pcs1">
							
						</div>
					</td>
					<td>
					<input type="button" name="derecha" id="derecha" value="-->"><br />
					<input type="button" name="derecha" id="derecha" value="<--">
					</td>
					<td>
						<div id="pcs2"></div>
					</td>
				</tr>
				</table>
			</form>';
			
?>